package guan.dao;

import guan.bean.ResCodeType;

import java.util.List;

import net.sf.autodao.AutoDAO;
import net.sf.autodao.Dao;
import net.sf.autodao.Finder;
import net.sf.autodao.Limit;
import net.sf.autodao.Named;
import net.sf.autodao.Offset;

@AutoDAO
public interface ResCodeTypeDao extends Dao<ResCodeType, Long> {

	@Finder(query = "from ResCodeType r where r.name like CONCAT('%',:like,'%') order by id")
	List<ResCodeType> page(@Offset int pageNum, @Limit int pageSize,
			@Named("like") String like);

	@Finder(query = "select count(*) from ResCodeType r where r.name like CONCAT('%',:like,'%')  ")
	long count(@Named("like") String like);

}
